﻿<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-access="property" default-lazy="true" namespace="Cms.Domain" assembly="Cms.Domain">
  <class name="MediaFile" table="cmsMediaFile">
    <cache usage="read-write" />
    <id name="ID" type="System.Int32" unsaved-value="0">
      <column name="ID" />
      <generator class="identity" />
    </id>
    <property name="Name" type="System.String">
      <column name="Name" not-null="true" />
    </property>
    <property name="Extension" type="System.String">
      <column name="Extension" not-null="true" />
    </property>
    <property name="Version" type="System.String">
      <column name="Version" not-null="true" />
    </property>
    <property name="Size" type="System.Int64">
      <column name="Size" not-null="true" />
    </property>
    <property name="UploadedTimestamp" type="System.DateTime">
      <column name="UploadedTimestamp" not-null="true" />
    </property>
    <property name="StartPublishing" type="System.Nullable`1[[System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <column name="StartPublishing" not-null="false" />
    </property>
    <property name="EndPublishing" type="System.Nullable`1[[System.DateTime, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <column name="EndPublishing" not-null="false" />
    </property>
    <property name="SortKey" type="System.String">
      <column name="SortKey" not-null="false" />
    </property>
    <bag name="Categories" table="cmsMediaFileCategory" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="MediaFileID" />
      </key>
      <many-to-many class="Category">
        <column name="CategoryID" />
      </many-to-many>
    </bag>
    <many-to-one class="Site" name="Site">
      <column name="SiteID" not-null="true" />
    </many-to-one>
    <many-to-one class="MediaFolder" name="Folder">
      <column name="FolderID" />
    </many-to-one>
    <map name="LocalizedProperties" table="cmsMediaFileLocalizedProperty" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="MediaFileID" />
      </key>
      <index type="System.Int32">
        <column name="LocaleID" />
      </index>
      <composite-element class="MediaFileLocalizedProperties">
        <property name="Title" type="System.String">
          <column name="Title" length="255" not-null="true" />
        </property>
        <property name="Description" type="System.String">
          <column name="Description" length="1000000" not-null="false" />
        </property>
      </composite-element>
    </map>
    <bag name="AllowedAdministratorGroups" table="cmsAdministratorGroupAllowedMediaFile" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="FileID" />
      </key>
      <many-to-many class="AdministratorGroup">
        <column name="GroupID" />
      </many-to-many>
    </bag>
    <bag name="DeniedAdministratorGroups" table="cmsAdministratorGroupDeniedMediaFile" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="FileID" />
      </key>
      <many-to-many class="AdministratorGroup">
        <column name="GroupID" />
      </many-to-many>
    </bag>
    <bag name="RequiredUserGroups" table="cmsMediaFileRequiredUserGroup" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="FileID" />
      </key>
      <many-to-many class="UserGroup">
        <column name="GroupID" />
      </many-to-many>
    </bag>
    <bag name="DeselectedUserGroups" table="cmsMediaFileDeselectedUserGroup" mutable="true">
      <cache usage="read-write" />
      <key>
        <column name="FileID" />
      </key>
      <many-to-many class="UserGroup">
        <column name="GroupID" />
      </many-to-many>
    </bag>
  </class>
</hibernate-mapping>